package com.liuer.service.impl;

import com.liuer.dto.UserDTO;
import com.liuer.entity.User;
import com.liuer.mapper.LoginMapper;
import com.liuer.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {


    @Autowired
    private LoginMapper loginMapper;
    /**
     * 进行登录验证
     * @param userDTO
     * @return
     */
    public User login(UserDTO userDTO) {
        return loginMapper.getUser(userDTO);
    }

    /**
     * 根据用户名判断用户是否存在
     * @param username
     * @return
     */
    public String getUserByUsername(String username) {
        return loginMapper.getUserByUsername(username);
    }
}
